package com.haoshuang.zhouzhoubang.ui.adapter

import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemIamge233Binding
import com.haoshuang.zhouzhoubang.model.bean.Image42Bean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.gone
import com.mufeng.libs.utils.view.load
import com.mufeng.libs.utils.view.visible


/**
 * 图片列表适配器
 * */
class ImageAdapter24(data: MutableList<Image42Bean>) :
    BaseBindingQuickAdapter<Image42Bean, ItemIamge233Binding>(data){

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: Image42Bean?) {
        if (item == null) return
        val binding = ItemIamge233Binding.bind(holder.itemView)
        binding.apply {
            if (item.isCheck==0){
                ivCheck.setImageResource(R.mipmap.dz_wx)
            }else{
                ivCheck.setImageResource(R.mipmap.dz_ok)
            }
            if (item.isVideo==0){
                imageView.load(item.image)
                ivVideo.gone()
            }else{
                imageView.load(item.image)
                ivVideo.visible()
            }

        }
    }

}